package InheritanceAndPolymorphism.demo04;

public class Car extends Auto{
    /**
     * 定义一个小汽车类Car，继承Auto，并添加空调、CD等成员变量，覆盖加速，减速的方法
     */

    private boolean airConditioner;
    private boolean cdPlayer;

    public Car(int tireCount, String color, double weight, boolean airConditioner, boolean cdPlayer) {
        super(tireCount, color, weight);
        this.airConditioner = airConditioner;
        this.cdPlayer = cdPlayer;
    }

    @Override
    public void accelerate(double increment) {
        super.accelerate(increment * 1.2);
    }

    @Override
    public void decelerate(double decrement) {
        super.decelerate(decrement * 1.2);
    }
}
